#include <stdio.h>

#define ROW 3
#define COL 4

void transpose(int arr[ROW][COL], int trans[COL][ROW]) {
    for (int i = 0; i < ROW; i++) {
        for (int j = 0; j < COL; j++) {
            trans[j][i] = arr[i][j];
        }
    }
}

int main() {
    int arr[ROW][COL] = {{1,2,3,4}, {5,6,7,8}, {9,10,11,12}};
    int trans[COL][ROW];
    transpose(arr, trans);
    printf("转置后的数组：\n");
    for (int i = 0; i < COL; i++) {
        for (int j = 0; j < ROW; j++) {
            printf("%d ", trans[i][j]);
        }
        printf("\n");
    }
    return 0;